<%@ page language="java" isELIgnored="false" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>抓取统计——恒拓运价魔方</title>
<script type="text/javascript" src="<%=request.getContextPath() %>/fare/js/show.js"></script> 
<link href="<%=request.getContextPath() %>/fare/css/base.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/fare/js/jquery-1.6.4.min.js"></script>
<link href="<%=request.getContextPath() %>/fare/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<%-- <link rev="stylesheet" media="all" href="<%=request.getContextPath() %>/fare/css/form_style.css" type="text/css" rel="stylesheet"> --%>
<script type="text/javascript" src="<%=request.getContextPath() %>/fare/js/datePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/ligerui.min.js"></script>
<script src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
<script	src="<%=request.getContextPath()%>/fare/lib/jquery/jquery.form.js"	type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/fare/form_Page.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/fare/form_page_1.js" type="text/javascript"></script>
<!-- 圆角文本框 -->
<link href="<%=request.getContextPath() %>/fare/css/htc/htc.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath() %>/fare/css/bt_class.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
.tooltips{
text-decoration:none;
position:relative;
z-index:2;
}
.tooltips:hover{
z-index:3;
background:none;
}
.tooltips span{
display: none;
}
.tooltips:hover span{
z-index:99999;
display:block;
position:absolute;  
margin:-25px 0px 0px -25px; border:0;
clear:both;
overflow:hidden;
margin:0;
padding:0;
border:1px solid black;
background-color:#DCDCDC;
padding:3px;
color:black;
}
.dateTd{
text-align:left;
width:1000px; 
height:30px;
border-right:1px solid #999d9c;
border-left:1px solid #999d9c;
border-top:1px solid #999d9c;
font-size:16px;
font-family:黑体;
}

</style>

<script type="text/javascript">
$(document).ready(function(){
	
	//初始化航线组件
	$('#depCity').querycity({'data':citysFlight,'tabs':labelFromcity});
	$('#arrCity').querycity({'data':citysFlight,'tabs':labelFromcity});
	
	if($("#depCity").val()=="" || $("#depCity").val()=="中文/拼音" ){
		if('${depCity}' !=null && '${depCity}' !=""){
			$("#depCity").val('${depCityName}(${depCity})');
		}
		
	}
	if($("#arrCity").val() =="" || $("#arrCity").val() =="中文/拼音"){
		if('${arrCity}' !=null && '${arrCity}'!=""){
			$("#arrCity").val('${arrCityName}(${arrCity})');
		}
	} 
	
	if($("#grabDate_1").val()=="" ){
		$("#grabDate_1").val('${grabDate_1}');
	}
	if($("#grabDate_2").val() ==""){
		$("#grabDate_2").val('${grabDate_2}');
	}
});
//弹出点击总数的信息
function open_crawl_setting()
{
	var url='<%=request.getContextPath() %>/taskInfoAction!findListSource.action';
	//在当前窗口重新打开一个
	parent.f_addTab("crawl_setting","抓取设置", url);
}

function open_singleLine_show(v1,v2)
{
	var depCitys=v1;
	var arrCitys=v2;
	var url='<%=request.getContextPath() %>/crawlInfoAction!findSingleLine.action?depCity='+depCitys+'&arrCity='+arrCitys;
	//在当前窗口重新打开一个
	parent.f_addTab("single_line_statistics","单航线抓取统计", url);
}
//日期
function find(){
	var grabDate_1=$("#grabDate_1").val();
	var grabDate_2=$("#grabDate_2").val();
	
	if(Date.parse(grabDate_1)> Date.parse(grabDate_2)){
		alert("查询日期范围不对!");
		return ;
	}
	
	$("#grabDateForm").attr("action","<%=request.getContextPath()%>/crawlInfoAction!getCrawlStatisticsReport.action?grabDate_1="+grabDate_1+"&grabDate_2="+grabDate_2);
	$("#grabDateForm").submit();
	
}
function clearAll(){
	$("#grabDate_1").val("");
	$("#grabDate_2").val("");
}
//航线
function findByLine(){
	var toCitys=$("#arrCity").val();
	var fromCitys=$("#depCity").val();
	if((toCitys !="" && toCitys !="中文/拼音") ||( fromCitys !="" && fromCitys !="中文/拼音")){
		if($.trim(toCitys)== $.trim(fromCitys)){
			alert("出发城市与到达城市不能相同");
			return ;
		}
	}
	fromCitys=encodeURI(encodeURI(fromCitys));
	toCitys=encodeURI(encodeURI(toCitys));
	$("#lineForm").attr("action","<%=request.getContextPath()%>/crawlInfoAction!getCrawlStatisticsReport.action?fromCitys="+fromCitys+"&toCitys="+toCitys);
	$("#lineForm").submit();

}
function clearAlls(){
	$("#depCity").val("");
	$("#arrCity").val("");
}
function get_lastDate(ymd,ym,n){  
    ymd=ymd?new Date(ymd.replace(/-/g,"/")):new Date();  
    ym&&(ym=="y"?ymd.setFullYear(ymd.getFullYear()-1):ymd.setMonth(ymd.getMonth()-1));  
    n&&ymd.setDate(ymd.getDate()+n);  
    return ymd.toLocaleDateString().match(/\d+/g).join('-');  
}  
</script>
</head>

<body>
	<div class="form_body">
		<div class="main_max">
			<div class="form_table_tltle" style="height:70px;background-color:#F0F0F0" >
				<table  width="0" border="0" cellspacing="0" cellpadding="0" margin="1"  >
					<tr border-spacing="12">
					<td align="left" height="5px" style="font-size:24px;font-family:黑体;" width="300px" >魔方抓取总览</td>
					<td width="300px"></td>
					<td align="" height="50px" style="font-size:15px"><font color="#808080">截止日期：${headVo.endDate}</font></td>
					</tr>
					<tr border-spacing="12"  style="border-buttom:1px solid #ff0000;">
						<td  align="center" style="font-size:14px">总数据量：
							<fmt:formatNumber type="number" maxFractionDigits="0" value="${headVo.allDataSizeLongs/(1024*1024)}" />M</td>
						<td align="center" style="font-size:14px">总航线数：${headVo.allLines}条</td>
						<td align="center" style="font-size:14px">目标网站：
							<a onclick="javascript:open_crawl_setting();" target="_blank" style="cursor:pointer";><font size="2.5pt" color="#0000FF">${headVo.grabs}</font></a>个</td>
					</tr>
				</table>
			</div>
			
			
			<div class="high_10"></div>
			
			<form id="grabDateForm">
				<table  width="0" border="0" cellspacing="0" cellpadding="0" margin="1"   >
					<tr >
						<td class="dateTd" >&nbsp;&nbsp;数据动态——按日期</td>
					</tr>
					<tr>
						<td class="left" style="border-right:1px solid #999d9c;border-left:1px solid #999d9c;height:40px">&nbsp;日期：&nbsp;&nbsp;
							<input name="grabDate_1" type="text"	id="grabDate_1" style="width: 129px"    
							onClick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'<s:text name='forms.locale'/>'})" readonly="readonly"/>
							&nbsp;至&nbsp;
							<input name="grabDate_2" type="text"	id="grabDate_2" style="width: 129px"    
							onClick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'<s:text name='forms.locale'/>'})" readonly="readonly"/>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="#" name=""  class="css_btn_class"  onclick="find()" style="margin-left:1px"/>查询
						<a href="#" name=""  class="css_btn_class"  onclick="clearAll()" style="margin-left:12px"/>清空
						</td>
					</tr>
					
				</table>
			</form>	
		
			
			<form action="" id="page_form">
			<table width="0" border="0" cellspacing="0" cellpadding="0" class="form_list">
				<tr class="title">
					<td style="text-align: center">序号</td>
					<td style="text-align: center">日期</td>
					<td style="text-align: center">当日航线数</td>
					<td style="text-align: center">当日数据量</td>
				</tr>
				<tbody id="table1">
				<c:forEach items="${allDatas}" var="vo" varStatus="status">
				<tr >
					<td class="line" style="text-align: center">${status.index+1}</td>
					<td class="line" style="text-align: center">${vo.dateStr}&nbsp;</td>
					<td class="line" style="text-align: center">
						<a class="tooltips" href="#tooltips" style="text-decoration:none"><font size="2.5pt" color="#0000FF">${vo.allLines}</font>
							<span><font size="2" style="line-height:12pt;padding:33px 0 0;">${vo.graResourceStr}<br>
						</a>
					</td>
					<td class="line" style="text-align: center">
						<a class="tooltips" href="#tooltips" style="text-decoration:none" ><font size="2.5pt" color="#0000FF">
						<fmt:formatNumber type="number" maxFractionDigits="0" value="${vo.allSourceSizeLong/(1024*1024)}" /> M</font>
							<span><font size="2" style="line-height:12pt;padding:33px 0 0;">${vo.sourceSizeStr}<br>
						</a>
					</td>
				</tr>
				</c:forEach>
				</tbody>
			
			</table>
			<span id="spanFirst_1" style="position:absolute;overflow:auto;cursor:default;left:800px">第一页</span> 
			<span id="spanPre_1" style="position:absolute;overflow:auto;cursor:default;left:845px">上一页</span> 
			<span id="spanNext_1" style="position:absolute;overflow:auto;cursor:default;left:890px">下一页</span> 
			<span id="spanLast_1" style="float:right;font-size:12px;">最后一页</span> 
			<span style="position:absolute;overflow:auto;cursor:default;left:695px">第</span> 
			<span id="spanPageNum_1" style="position:absolute;overflow:auto;cursor:default;left:715px" ></span>
			<span style="position:absolute;overflow:auto;cursor:default;left:730px">页/共</span>
			<span id="spanTotalPage_1" style="position:absolute;overflow:auto;cursor:default;left:760px" ></span>
			<span style="position:absolute;overflow:auto;cursor:default;left:780px">页</span>
		
		</form>
		
		
		<div class="high_10" style="height:30px;"></div>
		
		
			<form id="lineForm" action="" method="post">
				<table  width="0" border="0" cellspacing="0" cellpadding="0" margin="1"   >
					<tr >
						<td class="dateTd" >&nbsp;&nbsp;数据动态——按航线</td>
					</tr>
					<tr>
						<td class="left" style="border-right:1px solid #999d9c;border-left:1px solid #999d9c;height:40px">&nbsp;航线：&nbsp;&nbsp;
							<jsp:include page="../../inc/flightSelect.jsp"></jsp:include>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="#" name=""  class="css_btn_class"  onclick="findByLine()" style="margin-left:1px"/>查询
						<a href="#" name=""  class="css_btn_class"  onclick="clearAlls()" style="margin-left:12px"/>清空
						</td>
					</tr>
					
				</table>
			</form>	
		
			<form action="" id="page_form">
			<table width="0" border="0" cellspacing="0" cellpadding="0" class="form_list">
				<tr class="title">
					<td style="text-align: center">序号</td>
					<td style="text-align: center">航线</td>
					<td style="text-align: center">开始日期</td>
					<td style="text-align: center">截止日期</td>
					<td style="text-align: center">累积数据量</td>
				</tr>
				<tbody id="table2">
				<c:forEach items="${linesList}" var="vo" varStatus="status">
				<tr >
					<td class="line" style="text-align: center">${status.index+1}</td>
					<td class="line" style="text-align: center;">
						<a onclick="javascript:open_singleLine_show('${vo.fromCity}','${vo.toCity}');" target="_blank"  style="cursor:pointer;"><font  size="2.5pt" color="#0000FF">
						${vo.fromCityName}(${vo.fromCity})-${vo.toCityName}(${vo.toCity})</font></a>
					</td>
					<td class="line" style="text-align: center;">${vo.grabStartDate}</td>
					<td class="line" style="text-align: center">${vo.grabEndDate }</td>
					<td class="line" style="text-align: center">
						<fmt:formatNumber type="number" maxFractionDigits="0" value="${vo.sourceDataSize/(1024*1024)}" />M</td>
				</tr>
				</c:forEach>
				</tbody>
			
			</table>
			<span id="spanFirst" style="position:absolute;overflow:auto;cursor:default;left:800px">第一页</span> 
			<span id="spanPre" style="position:absolute;overflow:auto;cursor:default;left:845px">上一页</span> 
			<span id="spanNext" style="position:absolute;overflow:auto;cursor:default;left:890px">下一页</span> 
			<span id="spanLast" style="float:right;font-size:12px;">最后一页</span> 
			<span style="position:absolute;overflow:auto;cursor:default;left:695px">第</span> 
			<span id="spanPageNum" style="position:absolute;overflow:auto;cursor:default;left:715px" ></span>
			<span style="position:absolute;overflow:auto;cursor:default;left:730px">页/共</span>
			<span id="spanTotalPage" style="position:absolute;overflow:auto;cursor:default;left:760px" ></span>
			<span style="position:absolute;overflow:auto;cursor:default;left:780px">页</span>
		
		</form>
			
		</div>
		
		<div class="high_10"></div>
		
	</div>

	
	<!-- 存放查询数据的DIV -->
		<div id="re" align="center" style="width: 400;display:none;padding-top: 0px;">
		</div>
</body>
</html>
<script src="<%=request.getContextPath()%>/fare/form_page_1.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/fare/form_page_2.js" type="text/javascript"></script>
